<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link href="learningstyle.css" rel="stylesheet">
</head>
<body>
<h1>Dream Afar</h1>
<h2>A new way to explore the world</h2>
<input id="B-write" class="B-input"/>
<button type="button" value="搜索" id="B-search">搜索</button>
</body>
<script type="text/javascript">
    var write = document.getElementById("B-write");
    var search = document.getElementById("B-search");

    search.onclick = function () {
        location.href = "https://www.baidu.com/s?wd="+ write.value;
    }
</script>
</html>